#ifndef MYDB_H
#define MYDB_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QDebug>

class MyDB : public QObject
{
    Q_OBJECT
public:
    explicit MyDB(QObject *parent = nullptr);
    static MyDB* getInstance();
    QSqlQueryModel *m_model = NULL;

    void addStudent(QString id,QString name,QString gender,QString age);
    void delStudent(QString id);
    void addCourse(QString id,QString name,QString credit);
    void delCourse(QString id);
    void addGrade(QString sid,QString cid,QString grade);
    void delGrade(QString sid,QString cid);

signals:

private:
    QSqlDatabase m_db;
};

#endif // MYDB_H
